<template>
	<div class="component-item" :class="active?'selected':''" v-if="moduleData">
		<div class="flex center preview-item-top">
			<div class="del" @click.stop="delModule">
				<Icon type="ios-trash" size='22' style="color: white;" />
			</div>
		</div>
        <div class="component-content">
            <div class="disFlex Flex-between Flex-bottom">
                <div class="component-title">{{moduleData.label_name_cn}}</div>
                <template v-if="moduleData.more">
                    <div class="disFlex vertical" v-if="moduleData.more.display">
                        <div class="Flex"></div>
                        <div class="more">查看更多</div>
                    </div>
                </template>
            </div>
            <div class="component-desc">{{moduleData.label_info_summary}}</div>
            <div class="_content normal disFlex Flex-wrap" v-if="moduleData.data && moduleData.data.length > 0">
                <div class="_item disFlex vertical" v-for="(jtem,j) in moduleData.data">
                    <div class="_itemImage disFlex">
                        <div class="img bgCover Flex" :style="'background-image: url('+ jtem.image_path +')'"></div>
                    </div>              
                </div>
            </div>
            <!-- <div class="_content normal disFlex Flex-wrap" v-else>
                <div class="_item disFlex vertical" v-for="(jtem,j) in [1,2,3,4]">
                    <div class="_itemImage disFlex">
                        <div class="img bgCover Flex" style="background-image: url('');"></div>
                    </div>              
                </div>
            </div> -->
        </div>
    </div>
</template>

<script>

export default {
  	name: 'NormalModule',		
	props: {
		/**
	     * @description 起始值，即动画开始前显示的数值
	     */
	    moduleData: {
	      type: Object,
	      default: null
	    },
	    active: {
	    	type: Boolean,
	    	default: false
	    }
	},
    data () {
        return {
        	curpage: 0
    	}
    },
    methods: {
    	delModule() {
            this.$emit("delModule",this.moduleData);        
    	}
    },
    created() {
    },
    components: {
	}
 }
</script>

<style scoped>
@import url("../baseModule.less");
	
._content.normal ._item {
    width: 48%;
    margin-right: 4%;
}
._content ._item {
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid #f2f2f2;
}
._content.normal ._item{width: 48%;margin-right: 4%;}
._content.normal ._item:nth-child(2n){margin-right: 0}
._content.normal ._item ._itemImage .img{height:90px;}
.bgCover {
	background: #f8f8f8;
}
</style>
